import { combineReducers } from "redux";

const LOGIN_SUCCESS = "login_sucess";
export const initState = {
  loginData: {
    userName: "Caroline",
    password: "1111222"
  }
};

let reducers = combineReducers({
  loginData: function(state = {}, action) {
    switch (action.type) {
      case LOGIN_SUCCESS:
        return Object.assign({}, state, action.payload);
      default:
        return state;
    }
  }
});

export default reducers;
